# Copyright 2005-2007 Appnel Internet Solutions, Timothy Appnel,
# tim@appnel.com.

package MT::Plugin::TemplateLayouts;
use strict;

use base 'MT::Plugin';

if (MT->version_number < 4) {
    require MT::Template::Layouts::Tags;
}

my $plugin =
  MT::Plugin::TemplateLayouts->new(
    {
     id          => 'Layouts',
     key         => __PACKAGE__,
     name        => 'Template Layouts Toolkit',
     description => 'A toolkit for making reusable template layouts into tags.',
     doc_link => 'http://appnel.com/kb/devtools/movable-type-template-layouts',
     author_name => 'Appnel Solutions',
     author_link => 'http://appnel.com/',
     plugin_link => 'http://code.google.com/p/mt-template-layouts/',
     version     => $MT::Template::Layouts::VERSION,
    }
  );
MT->add_plugin($plugin);

sub instance { $plugin }

sub init_registry {
    $_[0]->registry(
          {
           'tags' => {
               'block' => {
                   'Invoke'         => 'MT::Template::Layouts::Tags::invoke',
                   'InvokeTag'      => 'MT::Template::Layouts::Tags::tag',
                   'InvokeContents' => 'MT::Template::Layouts::Tags::contents',
                   'InvokeSetArg'   => 'MT::Template::Layouts::Tags::set_arg',
                   'IfLayoutArgument?' => 'MT::Template::Layouts::Tags::if_arg',
                   'UnlessLayoutArgument?' =>
                     'MT::Template::Layouts::Tags::unless_arg',
               },
               'function' =>
                 {'LayoutArgument' => 'MT::Template::Layouts::Tags::arg',}
           }
          }
    );
}

1;
